package com.example.zhish.asynctask_demo001;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        /*
        执行顺序：
         onPreExecute......
         doInBackground......
         onProgressUpdate......
         onPostExecute......*/
        MyAsyncTask myAsyncTask = new MyAsyncTask();
        myAsyncTask.execute();
    }

    public void showImage(View view) {
        Intent intent = new Intent(this, ImageTest.class);
        startActivity(intent);

    }

    public void showProgress(View view) {
        startActivity(new Intent(this, ProgressBarTest.class));
    }
}
